package cb.wzby;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author wzby
 * @Date: 2022/7/30 11:30
 */
public class Set4 {
    public static void main(String[] args) {
        Set<Integer> s = new HashSet<>();
        s.addAll(List.of(1, 2, 3, 3, 4, 5, 5, 5, 8, 8, 8, 6, 6, 7, 9, 4, 1, 2 ));
        System.out.println(s.size());
        System.out.println(s);
        System.out.println(s.add(3));
        System.out.println(s.contains(8));
        if (s.contains(4)){
            System.out.println(s.remove(4));
        }
        System.out.println(s);
        System.out.println(s.removeAll(List.of(4,8,9,15)));
        System.out.println(s);
    }
}
